import pymysql

conn = pymysql.connect(
    host='localhost',
    user='root',
    password='01110190',
    database='sjk8_15',
    charset='utf8'
)

cursor = conn.cursor()

sql = """
    CREATE TABLE STUDENTS (
    id INT auto_increment PRIMARY KEY ,
    name CHAR(15) NOT NULL ,
    phone CHAR(11) NOT NULL 
    )ENGINE=innodb DEFAULT CHARSET=utf8;

"""
cursor.execute(sql)

sql_1 = 'insert into students(name,phone) values (%s,%s);'
data = [
    ('小刘', 15536987452),
    ('小天', 15325632548),
]
cursor.executemany(sql_1, data)

conn.commit()

cursor.close()
conn.close()

